<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>详情订单-win</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__common.css" />

    <style>
        .aui-bar-nav .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-bar-nav {
            background-color: #fff;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-pull-right {
            padding-right: 0.75rem;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }
        .delete{
            color:#333232!important;
        }
        body{
            background:#f5f5f5;
            padding-top:0.5rem;
        }
        .content{
            padding:0.75rem;
            background:#fff;
            margin-bottom:0.5rem;
        }
        .orderImg{
            width:5.9rem;
            height:4.1rem;
            margin-right:0.75rem;
            border-radius:0.25rem;
        }
        .orderContent{
            height:4.1rem;
            position:relative;
        }
        .title{
            font-size:0.71rem;
            color:#333;
        }
        .orderData{
            width:100%;
            font-size:0.7rem;
            color:#333;
            position: absolute;
            bottom:0;
        }
        .payContent{
            background:#fff;
            padding:0 0.75rem;
            margin-bottom:0.5rem;
        }
        .payTotal{
            width:100%;
            height:2.5rem;
            line-height: 2.5rem;
        }
        .name{
            font-size:0.8rem;
            color:#333;
        }
        .data{
            font-size:0.7rem;
            color:#333;
        }
        .changeColor{
            color:#FE0303;
            font-weight:500
        }
        .info{
            background:#fff;
            width:100%;
            min-height:4.25rem;
            padding:0.85rem 0.75rem;
            overflow: hidden;
        }
        .details{
            font-size:0.6rem;
            color:#999;
            margin-bottom:0.2rem;
        }
        .jianju{
            margin-bottom:0;
        }
        .toast-wrap {
            opacity: 0;
            position: fixed;
            bottom: 14%;
            color: #fff;
            width: 100%;
            text-align: center;
            font-size: 12px;
        }

        .toast-msg {
            background-color: rgba(0, 0, 0, 0.6);
            padding: 10px 15px;
            border-radius: 5px;
        }

        .toastAnimate {
            animation: toastKF 1s;

        }

        @keyframes toastKF {
            0% {
                opacity: 0;
            }
            25% {
                opacity: 1;
                z-index: 9999
            }
            50% {
                opacity: 1;
                z-index: 9999
            }
            75% {
                opacity: 1;
                z-index: 9999
            }
            100% {
                opacity: 0;
                z-index: 0
            }
        }
    </style>
</head>

<body>
<div class="l_box"  id="loading2"><img src="__IMG__loading.gif" alt="" id="loading"></div>

<header class="aui-bar aui-bar-nav underLine" style="padding-top:25px;" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
    <div class="aui-title">订单详情</div>
    <a class="aui-pull-right">
        <span class="aui-iconfont delete" tapmode="active" onclick="deleteorder()">删除订单</span>
    </a>
</header>

<div class="content flex-wrap underLine2">
    <img src="__IMG__jingtaitu/doctor.png" alt="" class="orderImg" id="classroom_img">
    <div class="orderContent flex-con">
        <div class="title aui-ellipsis-1" id="classroom_title">文章标题一共只有一行显示....</div>
        <div class="orderData order_money">¥99.00</div>
    </div>
</div>
<div class="payContent">
    <div class="payTotal flex-wrap underLine2">
        <div class="name">商品总价</div>
        <div class="flex-con"></div>
        <div class="data order_money">¥99.00</div>
    </div>
    <div class="payTotal flex-wrap underLine2">
        <div class="name">实付款</div>
        <div class="flex-con"></div>
        <div class="data changeColor order_money">¥199.00</div>
    </div>
    <div class="payTotal flex-wrap ">
        <div class="name">支付方式</div>
        <div class="flex-con"></div>
        <div class="data" id="order_type">支付宝</div>
    </div>
</div>
<div class="info">
    <div class="details" id="order_number">订单编号：78273839298</div>
    <div class="details" id="order_time">创建时间：2017-12-17</div>
    <div class="details jianju" id="pay_time">付款时间：2017-12-17  10:34:56</div>
</div>
<div class="toast-wrap">
    <span class="toast-msg"></span>
</div>
</body>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__doT.min.js"></script>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__common.js"></script>

<script type="text/javascript">
    var id=getUrlParam(location.href);
    getdata();
    function getdata() {
        loaddingOpen();
        $.ajax({
            url:'{:url("My/orderInfo")}',
            data:'order_id='+id,
            type:'POST',
            dataType:'JSON',
            success: function(data){
                loaddingClose();
                if (data.status==200) {

                    if (data.data.classroom_img==null||data.data.classroom_img==''){
                        $('#classroom_img').src="__IMG__zhanweitu/active_list.png";
                    }else{
                        $('#classroom_img').src=data.data.classroom_img;

                    }
                    $('#classroom_title').html(data.data.classroom_title);
                    $('.order_money').html(data.data.order_money);
                    $('#order_number').html('订单编号：'+data.data.order_number);
                    $('#order_time').html('创建时间：'+data.data.order_time);
                     $('#pay_time').html('付款时间：'+data.data.pay_time);
                     if (data.data.order_type==2) {
                         $('#order_type').html('微信');

                     }else if(data.data.order_type==1){
                         $('#order_type').html('支付宝');

                     }else {
                         $('#order_type').html('其他');

                     }
                }else {
                    toast(data.msg);
                }

            },
            error: function(xhr, type){
                loaddingClose();
                toast('无网络或连接超时，请重试！')
                // alert('Ajax error!');
                // 即使加载出错，也得重置

            }
        });

    }
// 删除订单
    function deleteorder() {
        loaddingOpen();
        $.ajax({
            url:'{:url("My/delOrder")}',
            data:'order_id='+id,
            type:'POST',
            dataType:'JSON',
            success: function(data){
                loaddingClose();
                console.log(data);
                if (data.status==200) {
                    toast('删除订单成功！');
                    setTimeout(function () {
                        window.history.go(-1);
                    },500);
                }else {
                    toast(data.msg);
                }

            },
            error: function(xhr, type){
                loaddingClose();
                toast('无网络或连接超时，请重试！')
                // alert('Ajax error!');
                // 即使加载出错，也得重置

            }
        });
    }

</script>

</html>
